﻿using Microsoft.SharePoint;

namespace System.Modules.SharePoint.Contracts.DTO
{
    /// <summary>
    /// Use this class in using statement to ensure event firing will be disabled
    /// </summary>
    public class DisableListItemEventFiring : SPItemEventReceiver, IDisposable
    {
        #region Constructor
        /// <summary>
        /// Constructor
        /// </summary>
        public DisableListItemEventFiring()
        {
            EventFiringEnabled = false;
        }
        #endregion

        #region IDisposable Members
        /// <summary>
        /// Dispose
        /// </summary>
        public void Dispose()
        {
            EventFiringEnabled = true;
        }
        #endregion
    }
}